package com.shujia.hbase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

import java.io.IOException;

public class Demo01ConnectionTest {
    public static void main(String[] args) throws IOException {

        Configuration conf = new Configuration();
        // 指定HBase地址
        conf.set("hbase.zookeeper.quorum", "master:2181,node1:2181,node2:2181");
        // 创建HBase连接
        Connection conn = ConnectionFactory.createConnection(conf);

        // 关闭连接
        conn.close();


    }
}
